select l.nama as tempat,b.nama as pemeriksa,a.patient_id as NoIndex,a.nik,a.nama_kk,a.nama,concat(a.umur," / ",a.bulanlahir," / ",a.harilahir) as umur,c.pekerjaan,o.pendidikan,a.alamat,d.desa,e.jenis,f.tindak_lanjut,g.unit,a.no_kartu,h.singkatan,i.dusun,j.kelompok_kunjungan,k.pengirim,k.pengirim,m.polirujukan,n.rs from visits a left join workers b on a.worker_id=b.id left join works c on a.work_id=c.id left join educations o on a.education_id=o.id left join villages d on a.village_id=d.id left join typepatients e on a.typepatient_id=e.id left join actions f on a.action_id=f.id left join units g on a.unit_id=g.id left join sexes h on a.sex_id=h.id left join orchards i on a.orchard_id=i.id left join groupvisits j on a.groupvisit_id=j.id left join consignors k on a.consignor_id=k.id left join poschecks l on a.poscheck_id=l.id left join polireferences m on a.polireference_id=m.id left join hospitals n on a.hospital_id=n.id where a.patient_id="2" and a.tanggal=(select substring(now(),1,10)) 
